
<html>
<head>
    <meta charset="UTF-8">
    <title>表模型工程信息新增</title>
    <link href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/css/esaas-easyui-add.css" rel="stylesheet" type="text/css"/>
    <script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
    <script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
    <script src="../../ffres/dict/all.js"></script>
    <a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout">
<form id="ff" method="post">
    <div class="esaas-info-title">领域信息</div>
    <table class="esaas-info-add-table">
        <tr>
            <td width="15%" align="right">领域代码：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="projectCode" data-options="required:true"
                                   style="width: 100%; height: 25px;"></input></td>
            <td width="15%" align="right">领域名称：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="projectName" data-options="required:true"
                                   style="width: 100%; height: 25px;"></input> <input type="hidden"
                                                                                      name="projectType" value="12"></input><input type="hidden"
                                                                                                                                   name="projectVersion" value="1.0.0"></input></td>
        </tr>
        <tr>
            <td width="15%" align="right">领域DBMS：</td>
            <td width="35%"><select class="easyui-combobox"
                                    id="projectDbms" name="projectDbms"
                                    style="width: 100%; height: 25px;"
                                    data-options="required:true,editable:false,valueField:'enname',textField:'cnname',data:PUB_DBMS_ID">
            </select></td>
            <td width="15%" align="right">&nbsp;</td>
            <td width="35%">&nbsp;</td>
        </tr>
        <tr>
            <td width="15%" align="right" valign="top">领域描述：</td>
            <td width="65%" colspan="3"><textarea name="projectDesc"
                                                  class="easyui-validatebox"
                                                  style="overflow-x: hidden; height: 60px; width: 98.5%;"></textarea>
            </td>
        </tr>
    </table>
</form>
<div style="text-align: center; padding: 15px">
    <a href="javascript:void(0)" class="easyui-linkbutton"
       onclick="submitForm()">&nbsp;保&nbsp;存&nbsp;</a> <a
        href="javascript:void(0)" class="easyui-linkbutton"
        onclick="closeForm()">&nbsp;关&nbsp;闭&nbsp;</a>
</div>
<script>
    $(function() {

    });
    var packageId = $.getUrlParam('packageId');
    var packageType = $.getUrlParam('packageType');

    function submitForm() {
        if (!$('#ff').form('validate'))
            return;
        var jsonData = $("#ff").serializeJson();
        $.restfulPostJson('../../api/project/tm/info',
            jsonData, function(data) {
                // window.parent.reloadList();
                let projectId = data.rows
                let treeObj = {
                    packageId: projectId,
                    packageCode: jsonData.projectCode,
                    packageName: jsonData.projectName,
                    packageAbvId: packageId,
                    packageType: packageType,
                    //packageUrl: 'esaas-dmcenter/ModelTableInfoList.html?packageId=' + projectId + '&projectId=' + projectId,
                }
                $.restfulPostJson('../../api/paas/sys/tree', treeObj, function(data) {
                    window.parent.reloadTree();
                    closeForm()
                });
        });
    };

    function closeForm() {
        window.parent.JLEUtil.closewin();
    }
</script>
</body>
</html>
